﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WindowsFormsView;

namespace WindowsFormsPresenter.InventoryItem
{
    public class InventoryItemsPresenter : Presenter<IInventoryItemsView>
    {
        public InventoryItemsPresenter(IInventoryItemsView view)
            : base(view)
        {
        }

        public void Display()
        {
            View.InventoryItems = Model.GetInventoryItems();
        }

        public void DisplayByPage(int currentPage, bool isMaterial)
        {
            View.InventoryItems = Model.GetInventoryItemsByPage(currentPage, isMaterial);
        }

        public void DisplayByPageAndBranch(int currentPage, bool isMaterial)
        {
            View.InventoryItems = Model.GetInventoryItemsByPageAndBranch(currentPage, isMaterial);
        }

        public void DisplayByPageAndCategory(int currentPage, string inventoryCategoryId)
        {
            View.InventoryItems = Model.GetInventoryItemsByPageAndCategory(currentPage, inventoryCategoryId);
        }

        public int GetTotalPage(bool isMaterial)
        {
            return Model.GetTotalPageFromInventoryItem(isMaterial);
        }

        public int GetTotalPageByCategory(string inventoryCategoryId)
        {
            return Model.GetTotalPageFromInventoryItemByCategory(inventoryCategoryId);
        }

        public void DisplayActive(bool isMaterial)
        {
            View.InventoryItems = Model.GetInventoryItemsActive(isMaterial);
        }

        public void DisplayActiveByBranch(bool isMaterial)
        {
            View.InventoryItems = Model.GetInventoryItemsActive(isMaterial);
        }
    }
}